<template>
  <section id="news" class="news">
    <div class="news-container">
      <div class="news-header">
        <h2 class="section-title">新闻动态</h2>
      </div>
      <div class="news-grid">
        <div class="news-card" v-for="item in newsItems" :key="item.id">
          <div class="news-date">{{ item.date }}</div>
          <h3 class="news-title">{{ item.title }}</h3>
          <p class="news-excerpt">{{ item.excerpt }}</p>
          <a href="#" class="news-link">查看详情 <span>→</span></a>
        </div>
      </div>
    </div>
  </section>
</template>

<script>
export default {
  name: 'News',
  data() {
    return {
      newsItems: [
        {
          id: 1,
          date: '2025-06-15',
          title: '快飞者发布全新一代工业级无人机',
          excerpt: '全新工业级无人机采用最新技术，提供更长续航和更高精度的航拍能力...'
        },
        {
          id: 2,
          date: '2025-05-28',
          title: '快飞者赞助全国无人机竞速大赛',
          excerpt: '作为行业领导者，快飞者积极支持无人机运动发展，赞助全国性赛事...'
        },
        {
          id: 3,
          date: '2025-04-10',
          title: '快飞者与多家企业达成战略合作',
          excerpt: '快飞者将与多个行业领先企业合作，共同推动无人机技术在各领域的应用...'
        }
      ]
    }
  }
}
</script>

<style scoped>
.news {
  background-color: #1a1a1a;
  color: #fff;
  padding: 40px 0;
}

.news-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.news-header {
  text-align: center;
  margin-bottom: 30px;
}

.section-title {
  font-size: 24px;
  font-weight: bold;
  color: #00ff00;
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background-color: #00ff00;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.news-card {
  background-color: #252525;
  border-radius: 10px;
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0, 255, 0, 0.1);
}

.news-date {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
}

.news-title {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.3;
}

.news-excerpt {
  font-size: 13px;
  color: #ddd;
  margin-bottom: 15px;
  line-height: 1.4;
}

.news-excerpt {
  font-size: 16px;
  color: #ddd;
  margin-bottom: 20px;
  line-height: 1.6;
}

.news-link {
  display: inline-block;
  color: #00ff00;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.news-link:hover {
  color: #00cc00;
}

.news-link span {
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.news-link:hover span {
  transform: translateX(5px);
}

/* Responsive design */
@media (max-width: 768px) {
  .section-title {
    font-size: 28px;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
}
</style>